package com.application.magazine;

import java.util.List;

import com.roscopeco.ormdroid.Entity;


public class Bookmarks extends Entity {
  public int id;
  public String page;
  public String path;
  public Magazine magazine;

  
  public Bookmarks() {
	  this(null);
  }
  public Bookmarks(String page) {
	  this.page = page;
  }



public Bookmarks(String page,String path) {
	this.page = page;
	this.path = path;
  }



public Bookmarks(String page,String path, Magazine magazine) {
	this.page = page;
	this.path = path;
	this.magazine = magazine;
}
public int getPk(){
	List<Bookmarks> list = null;
	int key = 1;
	list = query(Bookmarks.class).executeMulti();
	if(list!=null && !list.isEmpty()){
		key = list.size()+1;
	}
	return key;
	
}
public boolean checkDuplicate(String check){
	Bookmarks bm = null;
	boolean isDup =false;
	bm = query(Bookmarks.class).where("path").eq(check).execute();
	if(bm!=null ){
		isDup = true;
	}
	return isDup;
	
}


  
  
  
  
}
